package com.zxc.kafka.Listener;

import com.alibaba.fastjson.JSON;
import com.zxc.kafka.pojos.User;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class Consumer {

    @KafkaListener(topicPattern = "topic")
    public void a(String message) {
        User user = JSON.parseObject(message, User.class);

        System.out.println(user);
    }
}
